package io.finer.erp.jeecg.bas.controller;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.hutool.core.collection.CollUtil;
import io.finer.erp.jeecg.bas.entity.*;
import io.finer.erp.jeecg.bas.service.*;
import io.finer.erp.jeecg.bas.service.impl.BasCustomerAddressServiceImpl;
import org.apache.commons.lang.time.DateUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taobao.api.internal.util.StringUtils;

import io.finer.erp.jeecg.stock.entity.StkIoBill;
import io.finer.erp.jeecg.stock.entity.StkIoBillEntry;
import io.finer.erp.jeecg.stock.mapper.ScanMapper;
import io.finer.erp.jeecg.stock.service.IStkIoBillEntryService;
import io.finer.erp.jeecg.stock.service.IStkIoBillService;
import io.finer.erp.jeecg.stock.vo.CompanyModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description: 供应商不良品记录
 * @Author: jeecg-boot
 * @Date:   2020-08-19
 * @Version: V1.0
 */
@Api(tags="供应商不良品记录")
@RestController
@RequestMapping("/bas/zrkQuestion")
@Slf4j
public class ZrkQuestionController extends JeecgController<ZrkQuestion, IZrkQuestionService> {
	@Autowired
	private IZrkQuestionService zrkQuestionService;
	@Autowired
	private IBasSupplierService basSupplierService;
	@Autowired
	private IBasMaterialService basMaterialService;
	@Autowired
	private IStkIoBillService stkIoBillService;
	@Autowired
	private IStkIoBillEntryService stkIoBillEntryService;
	@Autowired
    private IBasCustomerService basCustomerService;
	@Autowired
	private IBasMaterialCategoryService basMaterialCategoryService;
	@Autowired
	private IZrkDeliverService zrkDeliverService;
	@Autowired
	private IZrkExpressService zrkExpressService;
	@Autowired
	private IZrkExpressEntryService zrkExpressEntryService;
	@Autowired
	private IZrkDeliverEntryService zrkDeliverEntryService;
	@Autowired
	private IZrkShoporderService zrkShoporderService;
	@Autowired
	private ScanMapper scanMapper;
	@Autowired
	private IBasMeasureUnitService basMeasureUnitService;
	@Autowired
	private IBasCustomerAddressService basCustomerAddressService;
	/**
	 * 分页列表查询
	 *
	 * @param zrkQuestion
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-分页列表查询")
	@ApiOperation(value="供应商不良品记录-分页列表查询", notes="供应商不良品记录-分页列表查询")
	@GetMapping(value = "/list")
	public Result<?> queryPageList(ZrkQuestion zrkQuestion,
			@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
			@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
			HttpServletRequest req) {
		QueryWrapper<ZrkQuestion> queryWrapper = QueryGenerator.initQueryWrapper(zrkQuestion, req.getParameterMap());
		Page<ZrkQuestion> page = new Page<ZrkQuestion>(pageNo, pageSize);
		IPage<ZrkQuestion> pageList = zrkQuestionService.page(page, queryWrapper);
		return Result.ok(pageList);
	}

	/**
	 *   添加
	 *
	 * @param zrkQuestion
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-添加")
	@ApiOperation(value="供应商不良品记录-添加", notes="供应商不良品记录-添加")
	@PostMapping(value = "/add")
	public Result<?> add(@RequestBody ZrkQuestion zrkQuestion) {
		zrkQuestionService.save(zrkQuestion);
		//当添加供应商不良品记录时同步更新供应商信息表中不良品的数量
		BasSupplier bs=basSupplierService.getById(zrkQuestion.getSupplierName());//suppliername中记录的是供应商ID
		//查询到供应商
		if(null!=bs) {
			int newBl=bs.getZrkCount()+zrkQuestion.getZrkCount();
			bs.setZrkCount(newBl);
			//更新供应商不良品数量
			basSupplierService.updateById(bs);
		}
		return Result.ok("添加成功！");
	}

	/**
	 *  编辑
	 *
	 * @param zrkQuestion
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-编辑")
	@ApiOperation(value="供应商不良品记录-编辑", notes="供应商不良品记录-编辑")
	@PutMapping(value = "/edit")
	public Result<?> edit(@RequestBody ZrkQuestion zrkQuestion) {
		//根据id查询该条信息
		ZrkQuestion zq=zrkQuestionService.getById(zrkQuestion.getId());
		//当审核状态为通过时，锁定该条数据，不允许再次审核
		if(zq.getIsLock()!=1) {
			String isCheck="";
			try {
				isCheck=zrkQuestion.getIsCheck();
			}catch(Exception e) {
				isCheck="";
			}
			//由于编辑、审核合二为一，此处需要判断is_check是否有值从而确定是否为审核
			if(StringUtils.areNotEmpty(isCheck)) {
				//获取登录用户信息
				LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
				zrkQuestion.setCheckUser(sysUser.getId());//设置审核人
				zrkQuestion.setIsLock(1);//锁定该条数据，不允许再次审核
			}
			zrkQuestionService.updateById(zrkQuestion);
			return Result.ok("编辑成功!");
		}else {
//			zrkQuestion.setIsCheck(zq.getIsCheck());//保持原来的状态不变
			return Result.ok("数据已锁定!");
		}
	}

	/**
	 *   通过id删除
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-通过id删除")
	@ApiOperation(value="供应商不良品记录-通过id删除", notes="供应商不良品记录-通过id删除")
	@DeleteMapping(value = "/delete")
	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
		System.out.println("question======="+id);
		ZrkQuestion zrkQuestion=zrkQuestionService.getById(id);
		System.out.println("zrkQuestion get supplier id ======="+zrkQuestion.getSupplierName());
		//当添加供应商不良品记录时同步更新供应商信息表中不良品的数量
		BasSupplier bs=basSupplierService.getById(zrkQuestion.getSupplierName());//suppliername中记录的是供应商ID
		//查询到供应商
		if(null!=bs) {
			int newBl=bs.getZrkCount()-zrkQuestion.getZrkCount();
			if(newBl<0) {
				newBl=0;
			}
			bs.setZrkCount(newBl);
			//更新供应商不良品数量
			basSupplierService.updateById(bs);
		}
		zrkQuestionService.removeById(id);
		return Result.ok("删除成功!");
	}

	/**
	 *  批量删除
	 *
	 * @param ids
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-批量删除")
	@ApiOperation(value="供应商不良品记录-批量删除", notes="供应商不良品记录-批量删除")
	@DeleteMapping(value = "/deleteBatch")
	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
		this.zrkQuestionService.removeByIds(Arrays.asList(ids.split(",")));
		return Result.ok("批量删除成功!");
	}

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-通过id查询")
	@ApiOperation(value="供应商不良品记录-通过id查询", notes="供应商不良品记录-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
		ZrkQuestion zrkQuestion = zrkQuestionService.getById(id);
		if(zrkQuestion==null) {
			return Result.error("未找到对应数据");
		}
		return Result.ok(zrkQuestion);
	}
	
	/**
	 * 通过id查询打印单据信息
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "供应商不良品记录-通过id查询")
	@ApiOperation(value="供应商不良品记录-通过id查询", notes="供应商不良品记录-通过id查询")
	@GetMapping(value = "/queryByIdData")
	public Result<?> queryByIdData(@RequestParam(name="id",required=true) String id) {
		ZrkQuestion zrkQuestion = zrkQuestionService.getById(id);
		if(zrkQuestion==null) {
			return Result.error("未找到对应数据");
		}
		//构造前端需要数据模型
		BLBean blBean=new BLBean();
		if(null!=zrkQuestion) {
			blBean.setHandlerTime(zrkQuestion.getUpdateTime());//设置处理时间
			//查询物料信息
			BasMaterial basMaterial=basMaterialService.getById(zrkQuestion.getMaterialName());
			if(null!=basMaterial) {
				blBean.setMaterialName(basMaterial.getName());
				blBean.setSupplier(zrkQuestion.getSupplierName());
				String appearenceRemark="无";
				String tonRemark="无";
				String qtyRemark="无";
				try {
					appearenceRemark=zrkQuestion.getAppearenceRemark();
					tonRemark=zrkQuestion.getTonRemark();
					qtyRemark=zrkQuestion.getQtyRemark();
				}catch(Exception e) {
					
				}
				blBean.setContent("1.外观:"+appearenceRemark+"\r\n"+"2.重量:"+tonRemark+"\r\n"+"3.质量:"+qtyRemark);
				//查询损失费用(101为采购入库单)
				QueryWrapper<StkIoBillEntry> queryWrapper=new QueryWrapper<StkIoBillEntry>();
				queryWrapper.eq("material_id", zrkQuestion.getMaterialName());
				List<StkIoBillEntry> sibeList=stkIoBillEntryService.list(queryWrapper);
				if(null!=sibeList&&sibeList.size()>0) {
					for(StkIoBillEntry sbe:sibeList) {
						//查询主单号
						StkIoBill sib=stkIoBillService.getById(sbe.getMid());
						//判断主单号是否为采购入库单
						if(sib.getStockIoType().equals("101")) {
							//计算单价
							BigDecimal price=sbe.getSettleAmt().divide(sbe.getSettleQty(),4,BigDecimal.ROUND_CEILING);
							BigDecimal total=new BigDecimal(zrkQuestion.getZrkCount()).multiply(price);
							blBean.setQrMoney(total);
							blBean.setSsMoney(total);
							break;
						}
					}
				}else {
					return Result.error("未查询到采购入库单");
				}
//				if(null!=sibe) {
//					//计算单价
//					BigDecimal price=sibe.getSettleAmt().divide(sibe.getSettleQty());
//					BigDecimal total=new BigDecimal(zrkQuestion.getZrkCount()).multiply(price);
//					blBean.setQrMoney(total);
//					blBean.setSsMoney(total);
//				}else {
//					return Result.error("未查询到数据");
//				}
			}else {
				return Result.error("未找到物料信息");
			}
		}
		return Result.ok(blBean);
	}
	
	/**
	 * 查询采购单打印数据
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "查询采购单打印数据")
	@ApiOperation(value="查询采购单打印数据", notes="查询采购单打印数据")
	@GetMapping(value = "/queryStkIoBill_601")
	public Result<?> queryStkIoBill_601(@RequestParam(name="id",required=true) String id) {
		//需要返回的数据
		PurchaseOrder po=new PurchaseOrder();
		ZrkSupplier sup=new ZrkSupplier();
		ZrkCustomer cus=new ZrkCustomer();
		LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
		po.setZdr(sysUser.getUsername());
		String orgName="";
		//根据id查询采购单信息
		StkIoBill sib=stkIoBillService.getById(id);
		if(null!=sib) {
		    try {
		    	po.setCreateTime(sib.getCreateTime());//创建时间
		    	//设置到货时间(订单时间+3天)
		    	po.setFhTime(DateUtils.addDays(sib.getCreateTime(), 3));
				//查询供应商信息
				BasSupplier bsp=basSupplierService.getById(sib.getSupplierId());

				BasCustomerAddress basCustomerAddress = basCustomerAddressService.getCustomAddress(bsp.getId());

				if(basCustomerAddress != null){
					sup.setAddress(basCustomerAddress.getAddress());//收件地址
					sup.setMobile(basCustomerAddress.getPhoneNo());//收件人电话
					sup.setUsername(basCustomerAddress.getContacts());//收件人
				}

				orgName=bsp.getName();
				sup.setOrgName(orgName);

			    po.setSup(sup);
				//查询启元信息
				BasCustomer bcs=basCustomerService.getById("1318447754322341890");
				cus.setAddress(bcs.getAccountReceipt());
				cus.setMobile(bcs.getPhoneReceipt());
				cus.setOrgName(bcs.getName());
				cus.setUsername(bcs.getAddressReceipt());
				po.setCus(cus);
			} catch (Exception e) {
		    	e.printStackTrace();
			}
			//查询Entry信息
			QueryWrapper<StkIoBillEntry> queryWrapper=new QueryWrapper<StkIoBillEntry>();
			queryWrapper.eq("mid", sib.getId());
			List<StkIoBillEntry> sibeList=stkIoBillEntryService.list(queryWrapper);
			List<PurchaseSubOrder> psoList=new ArrayList<PurchaseSubOrder>();
			if(null!=sibeList&&sibeList.size()>0) {
				for(StkIoBillEntry sibe:sibeList) {
					//物料物料分类信息
					BasMaterialCategory basCategory=basMaterialCategoryService.getById(sibe.getMaterialId());//查询到物料信息
					if(null!=basCategory) {
						PurchaseSubOrder purso=new PurchaseSubOrder();
						purso.setMaterialName(basCategory.getSupplierMaterialName());
						purso.setCount(sibe.getQty());
					    purso.setLongData(sibe.getWidth());
					    purso.setOrgName(orgName);//品牌
					    purso.setRemark(sibe.getRemark());//取第一个备注字段
						BasMeasureUnit unit=basMeasureUnitService.getById(basCategory.getUnitId());
						purso.setUnit(unit.getName());
						purso.setUnitPrice(sibe.getSettlePrice());
					    psoList.add(purso);
					}else {
						return Result.error("未查询到物料分类信息");
					}
				}
				po.setPso(psoList);//物料明细添加到返回实体类中
			}else {
				return Result.error("未查询到入库单明细数据");
			}
		}else {
			return Result.error("未查询到数据");
		}
		return Result.ok(po);
	}
	
	/**
	 * 查询发货单、出库单打印数据
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "查询发货单、出库单打印数据")
	@ApiOperation(value="查询发货单、出库单打印数据", notes="查询发货单、出库单打印数据")
	@GetMapping(value = "/queryFHBill")
	public Result<?> queryFHBill(@RequestParam(name="id",required=true) String id) {
		FHBillVO fhbv=new FHBillVO();
		LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
		fhbv.setZdr(sysUser.getUsername());
		List<FHBill> fhbList=new ArrayList<FHBill>();
		List<CKBill> ckbList=new ArrayList<CKBill>();
		//根据出货单id查询出货单信息
		ZrkDeliver zrkDeliver=zrkDeliverService.getById(id);
		//如果查询不到，则看看传入的id是不是销售订单的id如果是 则根据销售订单查询发货单
		if(null == zrkDeliver) {
			ZrkShoporder shoporder = zrkShoporderService.getById(id);
			if(null != shoporder){
				String no = shoporder.getOrderNo();
				List<StkIoBill> billList = stkIoBillService.lambdaQuery().eq(StkIoBill::getSourceNo, no).list();
				if(CollUtil.isNotEmpty(billList)){
					StkIoBill bill = billList.get(0);
					String billNo = bill.getBillNo();
					List<ZrkDeliver> deliverList = zrkDeliverService.lambdaQuery().eq(ZrkDeliver::getBillNo, billNo).list();
					if(CollUtil.isNotEmpty(deliverList)){
						zrkDeliver = deliverList.get(0);
					}
				}
			}
		}
		if(null!=zrkDeliver) {
            //查询货运方式字典
			List<CompanyModel> moList=scanMapper.getCompany("expressType");
			String hyMethod="";
			//查询物流信息
			QueryWrapper<ZrkExpress> zeQw=new QueryWrapper<ZrkExpress>();
			zeQw.eq("bill_no", zrkDeliver.getDeliverCode());
			ZrkExpress ze=zrkExpressService.getOne(zeQw);
			//查询出库单客户信息
			QueryWrapper<StkIoBill> queryWrapper=new QueryWrapper<StkIoBill>();
			queryWrapper.eq("bill_no", zrkDeliver.getBillNo());
			StkIoBill sib=stkIoBillService.getOne(queryWrapper.last("LIMIT 1"));
			ZrkCustomer cus=new ZrkCustomer();
			if(null!=sib) {
                //查询出库单明细
				QueryWrapper<StkIoBillEntry> sibQW=new QueryWrapper<StkIoBillEntry>();
				sibQW.eq("mid", sib.getId());
				List<StkIoBillEntry> sibeList=stkIoBillEntryService.list(sibQW);
				if(null!=sibeList&&sibeList.size()>0) {
					for(StkIoBillEntry sib2:sibeList) {
						CKBill ckb=new CKBill();
						ckb.setCount(new BigDecimal("1"));
						//查询物料信息
						BasMaterial mater=basMaterialService.getById(sib2.getMaterialId());
						if(null!=mater) {
							BasMaterialCategory bmc=basMaterialCategoryService.getById(mater.getCategoryId());
							ckb.setProductName(bmc.getCode());//将产品名称设置为分类code，防止名称外泄
							ckb.setRemark(mater.getRemark());
							ckb.setSpecs(mater.getWidth()+"*"+mater.getLength());
							ckb.setSpecsCount(new BigDecimal("1"));
							ckb.setSpecsUnit("卷");
							ckb.setSquare(mater.getSquare());//设置平方数
							//设置货运方式
							if(null!=ze) {
								hyMethod=ze.getExpressType();
								if(null!=moList&&moList.size()>0) {
									for(CompanyModel cm:moList) {
										if(ze.getExpressType().equals(cm.getValue())) {
											hyMethod=cm.getName();
											break;
										}
									}
								}
							}
							ckb.setHyMethod(hyMethod);//设置货运方式
							for(StkIoBillEntry sbe3:sibeList) {
								BasMaterial mate=basMaterialService.getById(sbe3.getMaterialId());
								if(null!=mate) {
									try {
										if(mater.getName().equals(mate.getName())&&mater.getWidth().compareTo(mate.getWidth())==0&&mater.getLength().compareTo(mate.getLength())==0) {
											ckb.setSpecsCount(ckb.getSpecsCount().add(new BigDecimal("1")));
										}
									} catch (Exception e) {
										log.info("数据异常", e);
										return Result.error("数据异常");
									}
								}else {
									return Result.error("未找到物料信息");
								}
							}
						}else {
							return Result.error("物料信息不存在");
						}
						ckbList.add(ckb);//添加到List
					}
					fhbv.setCkBillList(ckbList);//设置返回数据
				}
				BasCustomer cu=basCustomerService.getById(sib.getCustomerId());
				if(null!=cu) {
					cus.setAddress(cu.getAccountReceipt());
					cus.setMobile(cu.getPhoneReceipt());
					cus.setOrgName(cu.getName());
					cus.setUsername(cu.getAddressReceipt());
					cus.setCreatetime(zrkDeliver.getCreateTime());
					fhbv.setCus(cus);//设置出库单客户信息
				}else {
					return Result.error("客户信息未找到");
				}
				//查询启元信息
				BasCustomer bcs=basCustomerService.getById("1318447754322341890");
				cus.setAddress(bcs.getAccountReceipt());
				cus.setMobile(bcs.getPhoneReceipt());
				cus.setOrgName(bcs.getName());
				cus.setUsername(bcs.getAddressReceipt());
				fhbv.setQy(cus);
				//出库单读取收件人信息作为客户信息通过销售出库单的源单号查询商城订单信息
				QueryWrapper<ZrkShoporder> zsQW=new QueryWrapper<ZrkShoporder>();
				zsQW.eq("order_no", sib.getSourceNo());
				ZrkShoporder zso=zrkShoporderService.getOne(zsQW.last("LIMIT 1"));
				if(null!=zso) {
					ZrkCustomer zc=new ZrkCustomer();
					zc.setAddress(zso.getCustomerAddress());
					zc.setMobile(zso.getCustomerMobile());
					zc.setOrgName(zso.getCustomerName());
					zc.setUsername(zso.getCustomerName());
					zc.setCreatetime(sib.getCreateTime());
					fhbv.setCus2(zc);
				}else {
					return Result.error("销售订单未找到");
				}
			}else {
				return Result.error("未找到客户信息");
			}
			//查询物流信息
//			QueryWrapper<ZrkExpress> qw=new QueryWrapper<ZrkExpress>();
//			qw.eq("bill_no", zrkDeliver.getBillNo());
//			ZrkExpress zrkExpress=zrkExpressService.getOne(qw.last("LIMIT 1"));
			//查询物流明细信息
			QueryWrapper<ZrkDeliverEntry> qwZDE=new QueryWrapper<ZrkDeliverEntry>();
			qwZDE.eq("deliver_id", zrkDeliver.getId());
			List<ZrkDeliverEntry> zdeList=zrkDeliverEntryService.list(qwZDE);
			if(null!=zdeList&&zdeList.size()>0) {
				for(ZrkDeliverEntry zde:zdeList) {
					//比对是否为相同产品
					FHBill fb=new FHBill();
					//查询物料信息
					BasMaterial material=basMaterialService.getById(zde.getMaterialId());
					fb.setCount(new BigDecimal("1"));//件数
					fb.setMaterialName(material.getName());
					fb.setRemark(material.getRemark());
					fb.setSpecs(material.getWidth()+"*"+material.getLength());
					fb.setSpecsCount(new BigDecimal("1"));
					fb.setSpecsUnit("卷");
					fb.setSquare(material.getSquare());//平方数
					fb.setHyMethod(hyMethod);//设置货运方式
					//遍历运送明细，统计相同产品
					for(ZrkDeliverEntry zde2:zdeList) {
						//查询物料
						BasMaterial bm=basMaterialService.getById(zde2.getMaterialId());
						if(bm.getName().equals(material.getName())&&bm.getWidth().compareTo(material.getWidth())==0&&bm.getLength().compareTo(material.getLength())==0) {
							//同一产品合并
							fb.setCount(fb.getCount().add(new BigDecimal("1")));
							fb.setSpecsCount(fb.getSpecsCount().add(new BigDecimal("1")));
							fb.setSquare(fb.getSquare().add(bm.getSquare()));
						}
					}
					fhbList.add(fb);
				}
				fhbv.setFhBillList(fhbList);
			}else {
				return Result.error("未查询到物流明细信息");
			}
		}else {
			Result.error("未查询到数据");
		}
		return Result.ok(fhbv);
	}

	/**
	 * 导出excel
	 *
	 * @param request
	 * @param zrkQuestion
	 */
	@RequestMapping(value = "/exportXls")
	public ModelAndView exportXls(HttpServletRequest request, ZrkQuestion zrkQuestion) {
		return super.exportXls(request, zrkQuestion, ZrkQuestion.class, "供应商不良品记录");
	}

	/**
	 * 通过excel导入数据
	 *
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
	public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
		return super.importExcel(request, response, ZrkQuestion.class);
	}

}
